#include <iostream>

template<typename T>
class Product {
public:
    void display() {
        std::cout << "Displaying product of type " << typeid(T).name() << std::endl;
    }
};

template<typename T>
class Factory {
public:
    static T* create() {
        return new T();
    }
};

int main() {
    Product<int>* product1 = Factory<Product<int>>::create();
    product1->display();

    Product<double>* product2 = Factory<Product<double>>::create();
    product2->display();

    delete product1;
    delete product2;

    return 0;
}